package com.example.app.Entity;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import java.util.List;

@Dao
public interface MessageDao {
    @Insert
    void insert(Message message);
    
    @Query("SELECT * FROM messages WHERE sender_id = :senderId OR receiver_id = :receiverId")
    List<Message> getPrivateMessages(Long senderId, Long receiverId);
    
    @Query("SELECT * FROM messages WHERE group_id = :groupId")
    List<Message> getGroupMessages(Long groupId);
}